package com.caipiao.lottery.config;

/**
 * @author GaoFeng
 */

import java.io.File;

import com.caipiao.lottery.log.TraceLogger;

//抽象商品

public abstract class ConfigInterface
{
	protected String ConfigName = "";
	
	//配置文件
	protected String FilePath = "";
  
	//上次加载时间
	protected long lastModify = 0;
	
	//初始加载
	public boolean Load(String FilePath)
	{
        this.FilePath = FilePath;
        return this.ReLoad();
	}
	
	//重载检查
	public boolean CheckLoad()
	{
        try
        {
        	File cfgFile = new File(this.FilePath);
        	return (cfgFile.lastModified() > this.lastModify);
        }
        catch (Exception e)
        {
        	TraceLogger.System.error(ConfigName + "重载检查异常:" + FilePath + "|" + e.toString(), e);
        	return false; 
        }
	}
	
	//重加载
	public abstract boolean ReLoad();
}
